package com.bio.utils.mail;

import java.util.Properties;

/**
 * @author Xue Jun
 *
 */
public class MailProperties {
	// mail session resouce JNDI
	private String mailSessionJNDI = "java:comp/env/mailSession";
	// mail server and sender account
//	private String smtpHost = "192.168.1.101";
//    private String fromName = "上海必傲信息";
//    private String fromAddress = "admin@bioinfo.com";
//    private boolean bNeedAuthen = false; // smtp need authenticated?
//    private String password = "770926";
//    private String username = "admin@bioinfo.com";
    
    private String smtpHost = "smtp.163.com";
    private String fromName = "上海必傲信息";
    private String fromAddress = "wuyue4j@163.com";
    private boolean bNeedAuthen = false; // smtp need authenticated?
    private String password = "biobio123";
    private String username = "wuyue4j@163.com";
    
    // mail content types
    private String contentType = "text/html";
    private String charSet = "gb2312";
    /* Mode Types : 
     * 1> "TEST", the actual receivers will be replaced by the tester mail address and put the actual receivers in the mail body
     * 2> "PILOT", the actual receivers will be appended the tester mail address
     * 3> "PRODUCTION", it will sent to the actual receivers
     *  */
    private String modeType = MODE_TEST;//MODE_TEST; //By default is under "TEST" mode
    public static final String MODE_TEST = "TEST";
    public static final String MODE_PILOT = "PILOT";
    public static final String MODE_PRODUCTION = "PRODUCTION";
    private String[] testerAddressList = new String[]{"119435566@qq.com"};// password:passw0rd
    // properties for smtp protocal
    Properties props = new Properties();//System.getProperties();
    public MailProperties(){
    	props.put("mail.smtp.host", smtpHost);
    	props.put("mail.smtp.debug", "true");
    	props.put("mail.smtp.auth", Boolean.toString(bNeedAuthen));
    }
    
	public String getMailSessionJNDI() {
		return mailSessionJNDI;
	}
	public void setMailSessionJNDI(String mailSessionJNDI) {
		this.mailSessionJNDI = mailSessionJNDI;
	}
	public String getSmtpHost() {
		return smtpHost;
	}
	public void setSmtpHost(String smtpHost) {
		this.smtpHost = smtpHost;
	}
	public String getFromName() {
		return fromName;
	}
	public void setFromName(String fromName) {
		this.fromName = fromName;
	}
	public String getFromAddress() {
		return fromAddress;
	}
	public void setFromAddress(String fromAddress) {
		this.fromAddress = fromAddress;
	}
	public boolean isBNeedAuthen() {
		return bNeedAuthen;
	}
	public void setBNeedAuthen(boolean needAuthen) {
		bNeedAuthen = needAuthen;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getContentType() {
		return contentType;
	}
	public void setContentType(String contentType) {
		this.contentType = contentType;
	}
	public String getCharSet() {
		return charSet;
	}
	public void setCharSet(String charSet) {
		this.charSet = charSet;
	}
	public String getModeType() {
		return modeType;
	}
	public void setModeType(String modeType) {
		this.modeType = modeType;
	}

	public Properties getProps() {
		return props;
	}

	public String[] getTesterAddressList() {
		return testerAddressList;
	}

	public void setTesterAddressList(String[] testerAddressList) {
		this.testerAddressList = testerAddressList;
	}
    
}
